package com.samphanie.mbg.model.sys;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.samphanie.mbg.model.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.SuperBuilder;

import java.util.Date;
import java.util.List;


/**
 * 系统用户对象 sys_user
 *
 * @author zsy
 * @date 2021-10-20
 */
@Data
@With
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@TableName("sys_user")
@EqualsAndHashCode(callSuper = true)
public class SysUser extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户名")
    private String username;

    @ApiModelProperty(value = "用户昵称")
    private String nickname;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @ApiModelProperty(value = "手机号")
    private String mobile;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "部门ID")
    private Long deptId;

    @ApiModelProperty(value = "最后登录时间")
    private Date loginTime;

    @ApiModelProperty(value = "登录ip")
    private String lastIp;

    @Builder.Default
    @ApiModelProperty(value = "账户是否可用【0-禁用 1-启用】")
    private boolean enabled = true;

    @Builder.Default
    @ApiModelProperty(value = "账户是否过期【0-过期 1-正常】")
    private boolean accountNonExpired = true;

    @Builder.Default
    @ApiModelProperty(value = "账户是否锁定【0-锁定 1-正常】")
    private boolean accountNonLocked = true;

    @Builder.Default
    @ApiModelProperty(value = "密码是否过期【0-不可用 1-可用】")
    private boolean credentialsNonExpired = true;

    @TableField(exist = false)
    @ApiModelProperty(value = "用户角色")
    private List<SysRole> roles;

}
